
# -*- coding: cp1252 -*-
#########################################################
#                                                       #
# Classe Gerada pelo PyGenerator - Gets e Sets v. 1.0   #
# Criado por Raphoka e Amigos                           #
#                                                       #
#########################################################

class Funcionario:

#####################
# -- CONSTRUTOR --  #
#####################

    def __init__(self, Id = '', nome = '', CPF = '', email = '', login = '', senha = '', isAdm = '', cargo = '', ativo = ''):
        self.__Id = Id
        self.__nome = nome
        self.__CPF = CPF
        self.__email = email
        self.__login = login
        self.__senha = senha
        self.__isAdm = isAdm
        self.__cargo = cargo
        self.__ativo = ativo

######################
# -- GETS E SETS --  #
######################

    def getId(self):
        return self.__Id
    def setId(self, Id):
        self.__Id = Id

        
    def getNome(self):
        return self.__nome
    def setNome(self, nome):
        self.__nome = nome

        
    def getCPF(self):
        return self.__CPF
    def setCPF(self, CPF):
        self.__CPF = CPF

        
    def getEmail(self):
        return self.__email
    def setEmail(self, email):
        self.__email = email

        
    def getLogin(self):
        return self.__login
    def setLogin(self, login):
        self.__login = login

        
    def getSenha(self):
        return self.__senha
    def setSenha(self, senha):
        self.__senha = senha

        
    def isAdm(self):
        return self.__isAdm
    def setAdm(self, isAdm):
        self.__isAdm = isAdm
        self.__mudarAdm__()

        
    def getCargo(self):
        return self.__cargo
    def setCargo(self, cargo):
        self.__cargo = cargo

        
    def getAtivo(self):
        return self.__ativo
    def setAtivo(self, ativo):
        self.__ativo = ativo

        

#################
# -- METODOS -- #
#################

    def __mudarAdm__(self):
        if (self.__isAdm == False or self.__isAdm == 'False'):
            self.__isAdm = 0
        elif (self.__isAdm == True or self.__isAdm == 'True'):
            self.__isAdm = 1
    
    def __eq__(self, fun):
        if isinstance(fun, Funcionario):
            if (self.__nome.lower() == fun.getNome().lower()):
                return True
            else:
                return False
        else:
            return False
        
    def __len__(self):
        return len(self.__nome)
                
    
    def __str__(self):
        m = '''
Objeto Tipo: Funcionario

Atributos:

id: %s
nome: %s
CPF: %s
email: %s
login: %s
senha: %s
isAdm: %s
cargo: %s
ativo: %s
''' %(self.__Id, self.__nome, self.__CPF, self.__email, self.__login, self.__senha, self.__isAdm, self.__cargo, self.__ativo)
        return m
